home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 42 / Amiga Format AFCD42 (Issue 126, Aug 1999).iso / -serious- / misc / identify / identify_dev / examples / installify < prev    next >
Text File  |  1999-05-14  |  3KB  |  111 lines

  1. ;**********************************************************
  2. ;*                                                        *
  3. ;*           Identify Installer Script example            *
  4. ;*                                                        *
  5. ;**********************************************************
  6. ;*
  7. ;*      $VER: InstallIfy example 1.0 (3.1.1998)
  8. ;*      (C) 1998 Richard Körber -- All Rights Reserved
  9. ;*
  10. ;**********************************************************
  11.  
  12. (set @default-dest "")
  13.  
  14.  
  15. (message (cat
  16.   "\nWelcome to the\n\n"
  17.   "InstallIfy demonstration\n\n"
  18.   "InstallIfy is a support tool for the Amiga Installer. You can easily "
  19.   "check the system configuration and do some conditional installations "
  20.   "with the result.\n"
  21.   "You will see some short examples. Also have a look at the source."
  22.   )
  23. )
  24.  
  25.  
  26. ;
  27. ; This is the basic principle of InstallIfy. Just call it with the RUN
  28. ; command, and provide the field name you want to check. RUN returns
  29. ; the appropriate value, you just have to store it in a variable. Of
  30. ; course, you can also use the result at once.
  31. ;
  32. ; Do NOT forget the (safe) option, since you eventually want to check
  33. ; the environment even on a simulated installation.
  34. ;
  35. (set rc (run "c:InstallIfy System" (safe)))
  36. (if (= rc 11)       ; DraCo?
  37.   (message "\n\nThis program does not run on DraCo systems, sorry!\n")
  38.   (if (= rc 12)     ; UAE?
  39.     (message "\n\nUAE sucks! Buy the real thing!\n")
  40.     (message "\n\nYou seem to have a standard Amiga\n")
  41.   )
  42. )
  43.  
  44.  
  45. ;
  46. ; Let's check if AGA chipset is present.
  47. ;
  48. (set rc (run "c:InstallIfy Chipset" (safe)))
  49. (if (= rc 2)        ; AGA?
  50.   (message "\n\nYou have an AGA chipset\n")
  51.   (message "\n\nYou don't have an AGA chipset\n")
  52. )
  53.  
  54.  
  55. ;
  56. ; A more useful thing: let's find out what version of your programm
  57. ; should be installled.
  58. ;
  59. (set rc (run "c:InstallIfy CPU" (safe)))
  60. (if (< rc 2)        ; 68020 or higher?
  61.   (set cpudef 0)
  62.   (
  63.      ; Okay, we have at least an 68020 CPU. Let's find out if a FPU is
  64.      ; present as well.
  65.     (set rc (run "c:InstallIfy FPU" (safe)))
  66.     (if (= rc 0)    ; noFPU?
  67.       (set cpudef 1)
  68.       (set cpudef 2)
  69.     )
  70.   )
  71. )
  72. (set rc (run "c:InstallIfy POWERPC" (safe)))
  73. (if (<> rc 0)       ; PowerPC
  74.   (set cpudef 3)
  75. )
  76. (askchoice (prompt "What program version do you want to install?")
  77.            (help   "The default has been evaluated using InstallIfy")
  78.            (choices "68000" "68020+" "68020+ with FPU" "PowerPC")(default cpudef))
  79.  
  80.  
  81. ;
  82. ; Check out if the right PowerPC environment is present.
  83. ;
  84. (set rc (run "c:InstallIfy POWERPC" (safe)))
  85. (if (= rc 0)
  86.   (message "Uh, this program requires a PowerPC to run.")
  87.   (
  88.     (set rc (run "c:InstallIfy PPCOS" (safe)))
  89.     (if (= rc 1)
  90.       (message "This program requires WarpOS")
  91.       (if (= rc 2)
  92.         (message "This program requires PowerUp")
  93.         (message "You are using some unknown PowerPC OS")
  94.       )
  95.     )
  96.   )
  97. )
  98.  
  99.  
  100. (message (cat
  101.   "\nI hope you was quite impressed by this example.\n\n"
  102.   "If you have further questions, feel free to send me a mail:\n\n"
  103.   "shred@chessy.aworld.de"
  104.   )
  105. )
  106.  
  107. (exit)
  108.  
  109. ;********* DONE *******************************************
  110.  
  111.